<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        let x="America,Greece,Britain,Canada,China,Egypt"
        let y=x.split(",")
        let z=0
        for (let i  in y){
            if((y[i].indexOf("A"))!=-1){
                z++
            }else if((y[i].indexOf("a")!=-1)){
                z++
            }
        }
        document.write("包含A或a的字符串有"+z+"个")
    </script>
</head>
<body>
    
</body>
</html>